<?php
/**
 * View Archivio Booking LaFabbrica.org
 * 
 * @author     luigi.pastore (gigi@la-fabbrica.org)
 * @created    21-apr-2011
 * @package    LaFabbrica
 * @copyright  Copyright (c) 2011 Luigi Pastore
 */
?>
<script type="text/javascript">
    //<![CDATA[
     
     // Array degli Url dei singoli tab
var url = new Array(); 
url['live'] = "/admin/ajax/list/booking-live"; 
url['events'] = "/admin/ajax/list/booking-events"; 
url['activities'] = "/admin/ajax/get/booking-activities"; 
 
function loadTab(href) 
{ 
    // Elimina il # all'inizio dell'href
    href = href.substr(1,href.length);
    if (url[href].length > 0) 
    { 
        $("#preloader").show(); 
        $.ajax( 
        { 
            url: url[href], 
            cache: false, 
            success: function(message) 
            { 
                $("#tab-container").empty().append(message); 
                $("#preloader").hide(); 
            } 
        }); 
    } 
}   
     
    $(document).ready(function() {

	//Default Action
	$(".tab-content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	//$("ul.tabs li:first").show(); //Activate first tab
//	$(".tab-content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {
	    loadTab($(this).find("a").attr("href"));
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
//		$(".tab-content").hide(); //Hide all tab content
//		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
//		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});

    });
    loadTab('#live');
    

    
    
    //]]>
</script>
<div class="info">
    <h2>Booking</h2>
    <div>Per inserire un nuovo locale...</div>
</div>
<div id="content">
<div id="tabbed">
    <ul class="tabs">
        <li class="live"><a href="#live">Live</a></li>
        <li class="events"><a href="#events">Eventi</a></li>
        <li class="activities"><a href="#activities">Attivit&agrave;</a></li>
    </ul>
    <div id="tab-container" class="tab-container">
	<div id="preloader">
	    <span class="loader">Sto caricando...</span>
	</div>
<!--        <div id="live" class="tab-content live">
            TAB1
        </div>
        <div id="events" class="tab-content events">
            TAB2
        </div>
        <div id="activities" class="tab-content">
            TAB3
        </div>
        <div id="tab4" class="tab-content">
            TAB4
        </div>-->
    </div>
</div>
    
 </div>